Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implemented History Panel for reusing previously used Magnet & Torrent Links #245

Merged
merged 12 commits into from
Oct 21, 2023

Conversation

omjogani
Copy link
Contributor

Previously I mentioned an issue where I described the motivation to build this feature and why this feature is helping make the user experience better.
#244

Implementation Details

Local DB used to Store History: Isar DB It's a Super Fast Cross-Platform Database for Flutter.

New Files

  • ui/flutter/lib/api/model/history_data.dart: it contains the schema for History.
  • ui/flutter/lib/app/modules/history/controller/history_controller.dart: It communicates with History Local Instance to Store and fetch the data from Local DB to the App.
  • ui/flutter/lib/app/modules/history/views/history_view.dart: It's for the GUI of the History Panel Pop-up

Modifications

  • added Dependency
    • isar: ^3.1.0+1
    • isar_flutter_libs: ^3.1.0+1
    • isar_generator: ^3.1.0+1 (dev)
  • ui/flutter/lib/app/modules/create/views/create_view.dart: Added History Button beside Browse Button which opens up History Panel in the pop-up.

Screenshots

Add History Button
New History Pannel

How it's working?

  • Whenever the user copies the link or browses the file from the local system and clicks on the confirm button. It will add the URL string to the history panel.
  • When the User clicks on the History Button, a New History Pop-up will appear with a list of history data. When the User clicks on a specific history it will get added to the URL Field.

It's my contribution to the gopeed, an amazing app.
Thank You!

@monkeyWie
Copy link
Member

Thank for your contribution, it looks very nice! However, I noticed that a new library Isar DB used as a local store. This may increase the size of the app. As I want to keep the application as lightweight as possible, I suggest using the existing shared_preferences library instead.

@omjogani
Copy link
Contributor Author

I agree with your point! to migrate from Isar DB to shared_preferences I just need to make change in one file where whole DB communication takes place. I will do it soon.
Thanks for your suggestion!

ui/flutter/lib/app/modules/history/views/history_view.dart Outdated Show resolved Hide resolved
ui/flutter/lib/app/modules/history/views/history_view.dart Outdated Show resolved Hide resolved
ui/flutter/pubspec.yaml Outdated Show resolved Hide resolved
@monkeyWie
Copy link
Member

monkeyWie commented Oct 21, 2023

Looking forward to your updates! I have reviewed and commented on the code, so please follow up together.

@omjogani
Copy link
Contributor Author

Hey @monkeyWie,

I've made appropriate changes. Please review that and let me know if there are any changes required.
I've fully migrated from Isar DB to shared_preferences.

New Implementation

  • Clear History Button: It just clears out all the history.
  • Added Button as shown below

image

Thank you!

@monkeyWie
Copy link
Member

monkeyWie commented Oct 21, 2023

@monkeyWie monkeyWie changed the title Implemented History Panel for reusing previously used Magnet & Torrent Links feat: Implemented History Panel for reusing previously used Magnet & Torrent Links Oct 21, 2023
@monkeyWie monkeyWie added the enhancement New feature or request label Oct 21, 2023
@omjogani
Copy link
Contributor Author

Done with the changes you mentioned!

@monkeyWie
Copy link
Member

LGTM!

@codecov-commenter
Copy link

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (858ad74) 60.06% compared to head (1eb4f86) 59.90%.
Report is 2 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #245      +/-   ##
==========================================
- Coverage   60.06%   59.90%   -0.17%     
==========================================
  Files          19       19              
  Lines        2604     2621      +17     
==========================================
+ Hits         1564     1570       +6     
- Misses        850      860      +10     
- Partials      190      191       +1     
Files Coverage Δ
internal/protocol/http/fetcher.go 75.14% <73.52%> (-2.09%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@monkeyWie monkeyWie merged commit 32e3620 into GopeedLab:main Oct 21, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants